﻿<%@ Page Language="c#" CodeBehind="plan.aspx.cs" MasterPageFile="~/App_MasterPages/layout.Master"
    AutoEventWireup="false" Inherits="ud_gSDMS.project.plan" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<asp:Content ContentPlaceHolderID="leftContent" ID="MPLeftPane" runat="server" >
</asp:Content>
<asp:Content ContentPlaceHolderID="mainContent" ID="MPContent" runat="server">
  
<portal:mojoPanel ID="mp1" runat="server" ArtisteerCssClass="art-Post" RenderArtisteerBlockContentDivs="true">
    <mp:CornerRounderTop id="ctop1" runat="server" />
    <asp:Panel ID="pnlStoreManager" runat="server" CssClass="art-Post-inner panelwrapper gSDMS">
        <portal:ModuleTitleControlCustom ID="moduleTitle" runat="server" RenderArtisteer="true" UseLowerCaseArtisteerClasses="true"/>
        <script language="javascript" type="text/javascript">
            function FillValue()
            {
                var txtHours = document.getElementById('<%=txtHours.ClientID %>').value;
                document.getElementById('<%=txtDays.ClientID %>').value = (txtHours/8);
            }
        </script>
        <portal:mojoPanel ID="MojoPanel1" runat="server" ArtisteerCssClass="art-PostContent">
        <div class="modulecontent">
            <fieldset>
             <div class="div_Edit">
             <table cellpadding='2' cellspacing='0' border='0' width='auto' class="tb_edit">
               <tr >
                    <td colspan="8">
                         <table cellpadding=0 cellspacing=0 border=0>
                             <tr class="div_title_parent">
                               <td class="div_title div_title_group">PROJECT:</td>
                             </tr>
                        </table>
                     </td>
              </tr> 
                <tr>
                <td class="title title1">Project code:</td>
                <td class="input">
                <asp:HiddenField ID="hidId" runat="server" />
                <asp:HiddenField ID="hidCreatedOn" runat="server" />
                <asp:TextBox ID="txtProject_Code" runat="server" CssClass="txtInput" Width="200px"></asp:TextBox> 
                </td>
                <td class="title title1">Project name:</td>
                <td class="input">
                <asp:TextBox ID="txtProject_name" runat="server" CssClass="txtInput" Width="250px"></asp:TextBox>
                </td>
                <td colspan="4" rowspan="4">
                            <%-- cho nay la Memberlist hien thi mot gridview de xemn--%>
                                <asp:UpdatePanel ID="updatePanner1" runat="server" >
                                        <ContentTemplate>
                                             <table >
                                              <tr>
                                                <td class="gSDMS_Grid">
                                                <asp:GridView ID="grdMember" runat="server" CellPadding="4" ForeColor="#333333" GridLines="None" Width="100%" 
                                                    AllowPaging="false" AllowSorting="true" AutoGenerateColumns="false" PagerSettings-Position="Bottom" PagerStyle-HorizontalAlign="Right"
                                                    CssClass="css_grid" DataKeyNames="Project_ID">
                                                            <AlternatingRowStyle CssClass='AlternatingRowStyle' />
                                                            <EditRowStyle CssClass='EditRowStyle' />
                                                            <FooterStyle CssClass='FooterStyle' />
                                                            <HeaderStyle CssClass='HeaderStyle' />
                                                            <PagerStyle CssClass='PagerStyle' HorizontalAlign="Right" />
                                                            <RowStyle CssClass='RowStyle' />
                                                            <SelectedRowStyle CssClass='SelectedRowStyle' />
                                                            <Columns >
                                                                <asp:TemplateField HeaderText="STT" ItemStyle-CssClass="stt">
                                                                    <ItemTemplate><%# grdMember.PageIndex * grdMember.PageSize + grdMember.Rows.Count + 1%></ItemTemplate></asp:TemplateField>
                                                                <asp:TemplateField HeaderText="Member" ItemStyle-CssClass="txtusername" HeaderStyle-Width="100px">
                                                                    <ItemTemplate><%#Eval("LoginName")%></ItemTemplate></asp:TemplateField>
                                                                <asp:TemplateField HeaderText="Full Name" ItemStyle-CssClass="txtname2">
                                                                    <ItemTemplate><%#Eval("Name") %></ItemTemplate></asp:TemplateField>
                                                                <asp:TemplateField HeaderText="Role" ItemStyle-CssClass="txtRose" >
                                                                    <ItemTemplate><%#Eval("name2")%></ItemTemplate>
                                                                </asp:TemplateField>
                                                             </Columns>
                                                        </asp:GridView>
                                                    </td>
                                                </tr>
                                      </table>
                                </ContentTemplate>
                                </asp:UpdatePanel>                         
                           </td>            
            </tr>
            <tr>
                <td class="title title1">Project leader:</td>
                <td class="input">
                <telerik:RadComboBox ID="cboProject_leader" AllowCustomText="true" runat="server" CssClass ="cbo_rad" Width="100px" EmptyMessage="" Filter="Contains"></telerik:RadComboBox>
                 </td>
                <td class="title title1">Man Day:</td>
                <td class="input"><asp:TextBox ID="txtMan_day" runat="server" CssClass="txtInput txtdate" MaxLength="10" Width="50px"></asp:TextBox></td>
            </tr>
            <tr>
                <td class="title title1">Kickoff date:</td>
                    <td class="input"><asp:TextBox ID="datKickoff_Date" runat="server" CssClass="txtInput txtdate" MaxLength="10" Width="90px"></asp:TextBox></td>
                  <td class="title">End date:</td>
                 <td class="input"> <asp:TextBox ID="datEnd_Date" runat="server" CssClass="txtInput txtdate" MaxLength="10" Width="90px"></asp:TextBox></td>
                <td class="style4">
                    &nbsp;</td>
            </tr>
            <tr>
              <td colspan="8">
                                <table cellpadding=0 cellspacing=0 border=0>
                                    <tr class="div_title_parent">
                                        <td class="div_title div_title_group">ADD TASK:</td>
                                    </tr>
                                </table>
                            </td>
            </tr>
            <tr>
                <td class="title title1">Member:</td>
                <td class="input">
                <telerik:RadComboBox ID="cboMember" AllowCustomText="true" runat="server" CssClass ="cbo_rad" Width="100px" EmptyMessage="" Filter="StartsWith"></telerik:RadComboBox>
               <span class="star">(*)</span>
               <asp:RequiredFieldValidator ControlToValidate="cboMember" SetFocusOnError="true" ErrorMessage="***" Display="Dynamic" ID="RequiredFieldMembercbmember" runat="server" ValidationGroup="111"></asp:RequiredFieldValidator>
               </td>
               <td class="title title1">Work:</td>
               <td class="input">
               <telerik:RadComboBox ID="cboWork" AllowCustomText="true" runat="server" CssClass="cbo_rad" Width="100px" EmptyMessage="" Filter="StartsWith"></telerik:RadComboBox>
               <span class="star">(*)</span>
               <asp:RequiredFieldValidator ControlToValidate="cboWork" SetFocusOnError="true" ErrorMessage="***" Display="Dynamic" ID="RequiredFieldMembercbowork" runat="server" ValidationGroup="111"></asp:RequiredFieldValidator>
               </td>
               <td class="input" colspan="3">Work Description:
               <asp:TextBox ID="txtWork_Description" runat="server" CssClass="txtInput" Width="195px"></asp:TextBox>
               <span class="star">(*)</span>
               <asp:RequiredFieldValidator ControlToValidate="txtWork_Description" SetFocusOnError="true" ErrorMessage="***" Display="Dynamic" ID="RequireDescription" runat="server" ValidationGroup="111"></asp:RequiredFieldValidator> 
                </td>
                <td class="style5">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="title title1">From Date:</td>
                <td class="input"> 
                <telerik:RadDatePicker ID="dateFrom_DateProject" runat="server" 
                    DateInput-DateFormat="dd/MM/yyyy" DateInput-CssClass="txtInput" DateInput-MaxLength="10" Width="100px" Height="18px"
                    DatePopupButton-Width="23px" DatePopupButton-Height="23px">
                          <Calendar >
                              <SpecialDays>
                                  <telerik:RadCalendarDay Repeatable="Today" ItemStyle-CssClass="rcToday" />
                              </SpecialDays>
                          </Calendar>
                    </telerik:RadDatePicker>
                    <span class='span_note'>(dd/MM/yyyy)</span>
                <asp:RequiredFieldValidator ControlToValidate="dateFrom_DateProject" SetFocusOnError="true" ErrorMessage="***" Display="Dynamic" ID="RequiredFieldValidator2" runat="server" ValidationGroup="111"></asp:RequiredFieldValidator>
                </td>

                 <td class="title title_n1">To date:</td>
                 <td class="input"> 
                 <telerik:RadDatePicker ID="dateTo_DateProject" runat="server" 
                 DateInput-DateFormat="dd/MM/yyyy" DateInput-CssClass="txtInput" DateInput-MaxLength="10" Width="100px" Height="18px"
                 DatePopupButton-Width="23px" DatePopupButton-Height="23px">
                  <Calendar>
                      <SpecialDays>
                       <telerik:RadCalendarDay Repeatable="Today" ItemStyle-CssClass="rcToday" />
                      </SpecialDays>
                </Calendar>
              </telerik:RadDatePicker>
               <span class='span_note'>(dd/MM/yyyy)</span>
            <asp:RequiredFieldValidator ControlToValidate="dateTo_DateProject" SetFocusOnError="true" ErrorMessage="***" Display="Dynamic" ID="RequiredFieldValidator3" runat="server" ValidationGroup="111"></asp:RequiredFieldValidator>
               </td>
             <td class="input">Hours:
             <asp:TextBox ID="txtHours" runat="server" CssClass="txtInput" MaxLength="10" Width="50px" onblur="FillValue()"></asp:TextBox>
             <span class="star">(*)</span>
             <asp:RequiredFieldValidator ControlToValidate="txtHours" SetFocusOnError="true" ErrorMessage="***" Display="Dynamic" runat="server" ID="RequiredFieldValidatortxtHours" ValidationGroup="111"></asp:RequiredFieldValidator>
             <asp:RangeValidator ID="RangeValidHours" runat="server" ControlToValidate="txtHours" MinimumValue="1" Type="Integer" MaximumValue="7200" ErrorMessage= "Phải nhập số..."/>
              </td>
              <td class="input">Days:
                  <asp:TextBox ID="txtDays" runat="server" CssClass="txtInput" MaxLength="10" Width="50px"></asp:TextBox>
                <span class="star">(*)</span>
                <asp:RequiredFieldValidator ControlToValidate="txtDays" SetFocusOnError="true" ErrorMessage="***" Display="Dynamic" ID="RequiredFieldValidator1" runat="server" ValidationGroup="111"></asp:RequiredFieldValidator>
                 <asp:RangeValidator ID="RangeValidDays" runat="server" ControlToValidate="txtDays" MinimumValue="1" MaximumValue="1000" Type="Integer" ErrorMessage= "Phải nhập số..." />
               </td>
            </tr>
            <tr class="tr_action">
                <td class="style2">
                    &nbsp;</td>
                <td> <asp:Button ID='btnSave' runat="server" CssClass="btn_01 btn_save" Text="Save" ValidationGroup="111"/>
                <button id="Button2" class="btn_01" type="reset">Reset</button></td>
            </tr>
            <tr>
              <td colspan="8">
                <table cellpadding=0 cellspacing=0 border=0>
                 <tr class="div_title_parent">
                 <td class="div_title div_title_group">LIST TASK:</td>
                 </tr>
               </table>
              </td>
            </tr>
            <tr>
            <td>&nbsp;</td>
            <td colspan="6">
              <div class="gSDMS_Grid">
                   <asp:GridView ID="grdProjectPlan" runat="server" CellPadding="4" ForeColor="#333333" GridLines="None" Width="100%" 
                        AllowPaging="false" AllowSorting="true" AutoGenerateColumns="false" PagerSettings-Position="Bottom" PagerStyle-HorizontalAlign="Right"
                        CssClass="css_grid" DataKeyNames="Project_Plan_ID"
                        >                        
                        <AlternatingRowStyle CssClass='AlternatingRowStyle' />
                        <EditRowStyle CssClass='EditRowStyle' />
                        <FooterStyle CssClass='FooterStyle' />
                        <HeaderStyle CssClass='HeaderStyle' />
                        <PagerStyle CssClass='PagerStyle' HorizontalAlign="Right" />
                        <RowStyle CssClass='RowStyle' />
                        <SelectedRowStyle CssClass='SelectedRowStyle' />
                   
                        <Columns >
                            <asp:TemplateField HeaderText="STT" ItemStyle-CssClass="stt">
                                <ItemTemplate><%# grdProjectPlan.PageIndex * grdProjectPlan.PageSize + grdProjectPlan.Rows.Count + 1%></ItemTemplate></asp:TemplateField>
                          
                           <asp:TemplateField HeaderText="Member" ItemStyle-CssClass="txtMember" ItemStyle-HorizontalAlign="Center">
                                <ItemTemplate><%#Eval("UserID")%></ItemTemplate></asp:TemplateField>
                      
                           <asp:TemplateField HeaderText="Work" ItemStyle-CssClass="txtMember" ItemStyle-HorizontalAlign="Right">
                                <ItemTemplate><%#Eval("CAT_Project_Step_ID")%></ItemTemplate></asp:TemplateField>
                            
                            <asp:TemplateField HeaderText="Work Description" ItemStyle-CssClass="txt">
                                <ItemTemplate><%#Eval("Work_Description")%></ItemTemplate></asp:TemplateField>
                      
                            <asp:TemplateField HeaderText="From Date" ItemStyle-CssClass="txtdate">
                                <ItemTemplate><%#Eval("From_Date","{0:dd/MM/yyyy}")%></ItemTemplate></asp:TemplateField>

                            <asp:TemplateField HeaderText="To Date" ItemStyle-CssClass="txtdate">
                                <ItemTemplate><%#Eval("To_Date","{0:dd/MM/yyyy}")%></ItemTemplate></asp:TemplateField>
                            
                              <asp:TemplateField HeaderText="Days" ItemStyle-CssClass="txtnum" ItemStyle-HorizontalAlign="Right">
                                <ItemTemplate><%#Eval("Days")%></ItemTemplate></asp:TemplateField>
                            
                            <asp:TemplateField HeaderText="Hours" ItemStyle-CssClass="txtnum" ItemStyle-HorizontalAlign="Right">
                                <ItemTemplate><%#Eval("Hours")%></ItemTemplate></asp:TemplateField>
                            
                            <asp:TemplateField HeaderText="Edit" ItemStyle-CssClass="edit-del">
                                <ItemTemplate>
                                   <%-- <a class="edit" id ="Edi" href='<%# "/gsdmsmodule/timesheet/addnew_edit.aspx?pageid=16&id=" + Eval("Project_Plan_ID") %>' title="Edit">&nbsp;</a>--%>
                                    <asp:ImageButton ID="btnEdit" CommandName="edit" CommandArgument='<%# Eval("Project_Plan_ID") %>' CssClass="edit" runat="server" ToolTip="Delete" ImageUrl="~/Data/Sites/1/skins/StandardSkin/images/edit.png" OnClientClick="return confirm('Do you want to edit ?')"/>
                                </ItemTemplate></asp:TemplateField>

                            <asp:TemplateField HeaderText="Del" ItemStyle-CssClass="edit-del">
                                <ItemTemplate>
                                   <asp:ImageButton ID="btnDelete" CommandName="delete" CommandArgument='<%# Eval("Project_Plan_ID") %>' CssClass="delete" runat="server" ToolTip="Delete" ImageUrl="~/Data/Sites/1/skins/StandardSkin/images/delete.png" OnClientClick="return confirm('Do you want to delete?')"/>
                                </ItemTemplate></asp:TemplateField>
                        </Columns>

                        <EmptyDataTemplate>
                            <div class="div_dataEmpty">Data not found!</div>
                        </EmptyDataTemplate>
                    </asp:GridView>
                </div>
                 </td>
             </tr>           
             <tr>
                <td colspan="5" style="text-align: right">Hours</td>
                <td colspan="2" style="text-align: left"><asp:Label ID="lbHours" runat="server"></asp:Label></td>
                <td></td>
            </tr>
            <tr>
                <td colspan="5" style="text-align:right">Days</td>
                <td colspan="2" style="text-align :left"><asp:Label ID="lbDays" runat="server"></asp:Label></td>
                <td></td>
            </tr>
            <tr>
                <td colspan="5" style="text-align:right">Months</td>
                <td colspan="2" style="text-align:left"><asp:Label ID="lbMonth" runat="server"></asp:Label></td>
                <td></td>
            </tr>
            <tr>
                <td class="title">FeedBack:</td>
                <td class="input" colspan="3" rowspan = "4">
                   <mpe:EditorControl  ID="txtFeedBacks" runat="server" Width="600"></mpe:EditorControl>
                </td>
            </tr>                 
        </table>
        <table>
        <tr>
                <td class="title" style="padding-left:111px"></td>
                <td style="text-align:left"><asp:Button ID='btnSaveandSend' runat="server" class="btn_01" Text="Send" ToolTip="Gửi email cho GDDA nhắc duyệt và chuyển tình trạng dự án -> chờ duyệt"/>
                  &nbsp;&nbsp;                  
                <a href="/gsdmsmodule/project/manage.aspx" class="go_back">Go back</a>
                </td>
           </tr>
            <tr>
                <td class="title"></td>
                <td class="input"><asp:Label ID="lblMes" runat="server" Visible="false" CssClass="lblMes"></asp:Label></td>
            </tr>      
        </table>
      </div>
<%--                </ContentTemplate>
            </asp:UpdatePanel>--%>
                
            </fieldset>
        </div>
        </portal:mojoPanel>
        <div class="cleared"></div>
    </asp:Panel>
    <mp:CornerRounderBottom id="cbottom1" runat="server" />
    </portal:mojoPanel>
</asp:Content>
<asp:Content ContentPlaceHolderID="rightContent" ID="MPRightPane" 
    runat="server" >
</asp:Content>
<asp:Content ContentPlaceHolderID="pageEditContent" ID="MPPageEdit" runat="server" />
